package com.example.smart_community.mapper;

import com.example.smart_community.po.Notice;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface NoticeMapper {
    @Select("select * from notice ")
    List<Notice> selectAll();
    @Select("SELECT * from notice where id=#{id}")
    Notice selectById(Integer id);

    List<Notice> selectByTileAndTime(@Param("title") String title,@Param("time") String time);
    int updateNotice(@Param("id") Integer id,@Param("title")String title,@Param("content") String content,@Param("time") String time,@Param("person")String person);
    @Insert("insert into notice (title,content,time,person)VALUES(#{title},#{content},#{time},#{person})")
    int insertNotice(@Param("title")String title,@Param("content") String content,@Param("time") String time,@Param("person")String person);
    @Delete("delete from notice where id=#{id}")
    int deleteNotice(Integer id);
}
